{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "# -*- coding: utf-8 -*-\n",
    "\n",
    "class FileUtils(object):\n",
    "    \"\"\"docstring for FileUtils\"\"\"\n",
    "\n",
    "    def __init__(self):\n",
    "        # pass 这个神奇的东西,表示什么也不用做\n",
    "        pass\n",
    "\n",
    "    # 把文本读成一个 字符串数组\n",
    "    def readLine(self, filepath):\n",
    "        stringLists = [];\n",
    "        t = open(filepath, 'r', encoding='utf-8')\n",
    "        for line in t:\n",
    "            stringLists.append(line.strip());\n",
    "        return stringLists\n",
    "\n",
    "    def writeLine(self, filepath, lists):\n",
    "        f = open(filepath, \"w\", encoding=\"utf-8\")\n",
    "        count = 0\n",
    "        for list in lists:\n",
    "            f.write(list + '\\n')\n",
    "            if count % 10000 == 0: #1万行刷新一次\n",
    "               f.flush()\n",
    "        f.close()\n",
    "\n",
    "fileUtils = FileUtils();\n",
    "# stringLists = fileUtils.readLine('C:\\\\Users\\\\Administrator\\\\Desktop\\\\conf\\\\luceneindex\\\\shop.json');\n",
    "# print(len(stringLists));\n",
    "\n",
    "\n",
    "# codelist = fileUtils.readLine(\"D:\\\\Users\\\\yincy\\\\Desktop\\\\code.txt\")\n",
    "#\n",
    "# print(len(codelist));\n",
    "# # 现在的机场poiid\n",
    "# code1list = fileUtils.readLine(\"D:\\\\Users\\\\yincy\\\\Desktop\\\\code1.txt\")\n",
    "# print(len(code1list));\n",
    "#\n",
    "# for code1 in code1list:\n",
    "# \tif code1 not in codelist:\n",
    "# \t\tprint(code1)\n",
    "# \tpass\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1\n"
     ]
    }
   ],
   "source": [
    "print(1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
